package com.xiaoda.service.impl;

import com.xiaoda.dao.LikeDao;
import com.xiaoda.entity.Like;
import com.xiaoda.service.LikeService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class LikeServiceImpl implements LikeService {

    @Autowired
    LikeDao likeDao;

    @Override
    public List<Like> findAll() {
        return likeDao.findAll();
    }

    @Override
    public Like findByUid(String fromUid, String toUid) {
        return likeDao.findByUid(fromUid, toUid);
    }

    @Override
    public int addLike(Like like) {
        return likeDao.addLike(like);
    }

    @Override
    public int delLikeByUid(String fromUid, String toUid) {
        return likeDao.delLikeByUid(fromUid, toUid);
    }

    @Override
    public Like isArticleLiked(String fromUid, int toAid) {
        return likeDao.isArticleLiked(fromUid, toAid);
    }

    @Override
    public int addLikeArticle(String fromUid, int toAid) {
        return likeDao.addLikeArticle(fromUid, toAid);
    }

    @Override
    public int delLikeArticle(String fromUid, int toAid) {
        return likeDao.delLikeArticle(fromUid, toAid);
    }

    @Override
    public List<Like> findAllConcern(String fromUid, int start, int end) {
        return likeDao.findAllConcern(fromUid, start, end);
    }

    @Override
    public List<Like> findAllConcerned(String toUid, int start, int end) {
        return likeDao.findAllConcerned(toUid, start, end);
    }

    @Override
    public List<Like> findConcernArticle(String fromUid, int start, int end) {
        return likeDao.findConcernArticle(fromUid, start, end);
    }

    @Override
    public List<Like> findAllFollowed(String account, int start, int end) {
        return likeDao.findAllFollowed(account, start, end);
    }

    @Override
    public int countLikeNum(String account) {
        return likeDao.countLikeNum(account);
    }

    @Override
    public int deleteByUid(String uid) {
        return likeDao.deleteByUid(uid);
    }

    @Override
    public int deleteByAid(int aid) {
        return likeDao.deleteByAid(aid);
    }

}
